var pageJSON = require('./package.json');
const fs = require('fs');
const path = require('path');

fs.readFile(path.join(__dirname, './json/hp_mph.json'), 'utf8', function(err, data) {
    if (err) throw err;
    let list = JSON.parse(data);
    // list.forEach((item,index)=>{
    //     let value = item.properties;
    //     let result = {};
    //     result.ID = index + 1;
    //     result.TYPE = value.FLAG_A;
    //     result.X = value.X;
    //     result.Y = value.Y;
    //     newList.push(result);
    // })
    let newContent = JSON.stringify(newList, null, 4);
    fs.writeFile('result.json', newContent, 'utf8', (err) => {
        if (err) throw err;
        console.log('success done');
    });
});



console.log(pageJSON.scripts);